package com.nineclock.approve.resolver;

import cn.hutool.json.JSONObject;
import org.activiti.bpmn.model.Process;
import org.activiti.bpmn.model.UserTask;

// 审批节点处理器
public class ApproveNodeResolver extends ProcessNodeResolver{
    @Override
    public void addFlowNodeToActiviti(Process process, JSONObject currNode, JSONObject nextNode) {
        // 创建审批节点
        UserTask userTask = new UserTask();
        userTask.setId(getNodeId(currNode));
        userTask.setName(currNode.getStr("name"));
        userTask.setCategory("1"); // 1代表审批 2 代表抄送
        process.addFlowElement(userTask);
        // 绘制连线
        newSequenceFlow(process, currNode, nextNode);
    }
}
